package com.knowif.service;

import java.util.ArrayList;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.knowif.dao.UserShareMapper;
import com.knowif.pojo.UserShare;
import com.knowif.pojo.UserShareExample;
import com.knowif.util.commonUtil.IntegerUtil;

@Service
public class UserShare_service {
	
	@Autowired
	private UserShareMapper userShareMapper;
	
	public List<UserShare> selectByUserRedpacketId(Integer userRedpacketId) {
		if(IntegerUtil.isEmpty(userRedpacketId)){
			return new ArrayList<UserShare>();
		}
		UserShareExample userShareExample = new UserShareExample();
		userShareExample.createCriteria().andUserRedpacketIdEqualTo(userRedpacketId);
		return userShareMapper.selectByExample(userShareExample);
	}
	
	
	
	public int insert(UserShare userShare){
		if(userShare == null){
			return 0;
		}
		return userShareMapper.insert(userShare);
	}
	
	

}













